package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.Adv;
import com.bxj.wxtt.api.domain.AdvEx;
import com.bxj.wxtt.mapper.master.AdvExMasterMapper;
import com.bxj.wxtt.mapper.slave.AdvExSlaveMapper;
import com.bxj.wxtt.service.AdvExService;
import com.ifeng.matrix.common.domain.PageResult;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 15:38:15
 */
@Component("advExService")
public class AdvExServiceImpl implements AdvExService {
    @Resource
    AdvExMasterMapper advExMasterMapper;

    @Resource
    AdvExSlaveMapper advExSlaveMapper;

    public List<Adv> getAdvRelationList(AdvEx advEx) {
        return advExSlaveMapper.getAdvRelationList(advEx);
    }

    public PageResult<AdvEx> getAdvRelationPage(AdvEx advEx) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(advExSlaveMapper.countSeletive(advEx));
        pageResult.setResult(advExSlaveMapper.getAdvRelationList(advEx));
        return pageResult;
    }

    public int insert(AdvEx advEx) {
        return advExMasterMapper.insert(advEx);
    }

    public int deleteAdvRelationById(Integer id) {
        return advExMasterMapper.deleteAdvRelationById(id);
    }

}